import java.util.Arrays;
import java.util.List;
import wicket.PageParameters;
import wicket.markup.html.WebPage;
import wicket.markup.html.form.DropDownChoice;
import wicket.markup.html.form.Form;
import wicket.markup.html.form.TextField;
import wicket.markup.html.panel.FeedbackPanel;
import wicket.model.Model;

public class Index extends WebPage 
{
    private static final String ZIPCODE = "ZIPCODE";
    private static final String PHONE = "PHONE";
    private static final List<String> TYPES = Arrays.asList(new String[] {ZIPCODE, PHONE});
    
    public Index(final PageParameters parameters) 
    {
        add(new FeedbackPanel("feedback"));
        final DropDownChoice<String> type = new DropDownChoice<String>("type", new Model<String>(ZIPCODE), TYPES);
        type.setRequired(true);
        final TextField<String> keywords = new TextField<String>("keywords", new Model<String>());
        keywords.setRequired(true);
        Form< ? > form = new Form<Void>("form") {
            @Override
            protected void onSubmit() {
                info("Form successfully submitted");
            }
        }
        add(form);
        form.add(type);
        form.add(keywords);
    }
}
